<?php
/**
 * @orm tablename items as i
 * @orm left join artists as a ON (items.performer = artists.id)
 * @orm readonly
 */
class QueryItem {
	
	/**
	 * @orm char(300)
	 */
	public $name;
	/**
	 * @orm tablename artists
	 * @orm char(300)
	 */
	public $performerName;
	/**
	 * @orm tablename artists
	 * @orm int(11)
	 */
	public $performerId;
	
}


class SamleObject extends DomArDomainObject {
	
	public function delete() {
		
		$this->beforeDelete();
		
		$mapper = self::getMapper();
		properties['name']->beforeDelete();
		
	}
	
}







class A {
	
	public $name;
	
	public function __construct( $name ) {
		$this->name = $name;
	}

public function prepare() {
		
	}
}

class B {
	
	public $var = array();
	
	public function addVar( A $a ) {
		$this->var[$a->name] = $a;
	}
	
	
	
}


$t = microtime(true);
for( $i=0; $i<50; $i++ ) {
	$b = new B();
	$b->var = array(
		'name' => new A('name'),
		't' => new A('t'),
		'c' => new A('c'),
	);
}
echo microtime(true)-$t.'<br />';


$t = microtime(true);
for( $i=0; $i<50; $i++ ) {
	$b = new B();
	$b->var['name'] = new A('name');
	$b->var['t'] = new A('t');
	$b->var['c'] = new A('c');
}
echo microtime(true)-$t.'<br />';


$t = microtime(true);
for( $i=0; $i<50; $i++ ) {
	$b = new B();
	$b->addVar( new A('name') );
	$b->addVar( new A('t') );
	$b->addVar( new A('c') );
}
echo microtime(true)-$t.'<br />';




$t = microtime(true);
for( $i=0; $i<50; $i++ ) {
	$b->var['name']->prepare();
	$b->var['t']->prepare();
	$b->var['c']->prepare();
}
echo microtime(true)-$t.'<br />';


$t = microtime(true);
for( $i=0; $i<50; $i++ ) {
	foreach( $b->var as &$e ) {
		$e->prepare();
	}
}
echo microtime(true)-$t.'<br />';
?>